<template>
    <div class="tips" v-if="getShowTipsSate">
        <slot name='title'></slot>
        <slot name="cont"></slot>
        {{content}}
    </div>
</template>

<script>
export default {
    name:'Tips',
    props:['content'],
    computed:{
        getShowTipsSate:function(){
            setTimeout(()=>{
                this.$store.commit('hideCpn','isShowTips')
            },2000)
            return this.$store.state.isShowTips// 从vuex中获取是否登录,如果登录isShowTips则返回为false,此组件就不显示
        }
    }
}
</script>

<style>
    .tips{
        padding: 10px 20px;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        top:50%;
        transform: translateX(-50%);
        z-index: 9;
        color:white;
        background: rgba(0,0,0,.5);
        box-shadow: 0 0 3px #999;
        border-radius: 3px;
    }
</style>